package com.yanqu.road.entity.enums;

import java.util.Objects;

public enum ePlatformForbiddenType {

    CHAT(1, "chat", "聊天"),
    LOGIN(2, "login", "登录"),
    RANK(3, "rank", "禁止榜单"),
    ZS(4, "zs", "招商"),
    BANNED(5, "banned", "封号"),
    BAN_SPEAK(6, "banSpeak", "禁言"),
    TRUSTEESHIP(7, "trusteeship", "托管"),
    DISABLE_EDIT_NAME(8, "disableEditName", "禁止修改名称/昵称"),
    DISABLE_EDIT_HEAD(9, "disableEditHead", "禁止修改头像"),
    RESET_HEAD(10, "resetHead", "重置头像"),
    CROSS_BANNED(11, "crossBanned", "封禁跨服"),
    UNION_INFO_BANNED(12, "unionInfoBanned", "禁止修改商会信息"),
    UNBLOCK_CHAT_SHIELD(13, "UnblockChatShield", "聊天屏蔽"),
    IP_BANNED(14, "ipBanned", "IP封禁");

    private final int type;
    private final String name;
    private final String desc;

    ePlatformForbiddenType(int type, String name, String desc) {
        this.type = type;
        this.name = name;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public static ePlatformForbiddenType forName(String name) {
        for (ePlatformForbiddenType type : ePlatformForbiddenType.values()) {
            if (Objects.equals(type.name, name)) {
                return type;
            }
        }
        return null;
    }

    public static ePlatformForbiddenType forType(int type) {
        for (ePlatformForbiddenType data : ePlatformForbiddenType.values()) {
            if (data.type == type) {
                return data;
            }
        }
        return null;
    }
}
